home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d21
/
vfos_dv.arc
/
MACROS.INC
< prev
next >
Wrap
Text File
|
1990-08-09
|
7KB
|
185 lines
;
; VFOS_IBM VFOSSIL driver by Bob Hartman (SysOp of 1:132/101).
; Copyright 1988 by Spark Software. ALL RIGHTS RESERVED.
;
Enter_Vio macro
push bp
mov bp,sp
push bx
push cx
push dx
push si
push di
push ds
push es
push cs
pop ds
endm
Exit_Vio macro functype,numret
f&functype&_out:
pop es
pop ds
pop di
pop si
pop dx
pop cx
pop bx
mov sp,bp
pop bp
ret numret
endm
Locate_Cursor macro functype
mov ah,2 ; set cursor call
push si ; save pointer
int 10h ; dx already set, so go ahead
pop si ; get pointer back
inc dl ; increment column count
cmp dl,79 ; is it too high
jle f&functype&_10 ; it is ok
sub dl,80 ; subtract the 80 columns
inc dh ; increment the row
f&functype&_10:
endm
Check_Handle macro functype
mov ax,[bp+6] ; get handle
or ax,ax ; is it zero
jz f&functype&_1 ; it is ok
mov ax,436 ; bad handle
jmp f&functype&_out ; return
f&functype&_1:
endm
Do_Row_Col macro functype,row,col
IFDEF DIRECT
mov ax,[bp+row] ; get row
cmp ax,0 ; is it less than 0
jae f&functype&_2 ; ok so far
mov ax,358 ; bad row
jmp f&functype&_out ; get out
f&functype&_2:
cmp ax,24 ; is it greater than 24
jbe f&functype&_3 ; ok so far
mov ax,358 ; bad row
jmp f&functype&_out ; get out
f&functype&_3:
mov cl,5
shl ax,cl ; multiply by 32
mov di,ax ; save this
shl ax,1 ; multiply by 64
shl ax,1 ; multiply by 128
add di,ax ; add it in, now it is a total of 160x
mov ax,[bp+col] ; get column
cmp ax,0 ; is it less than 0
jae f&functype&_4 ; ok so far
mov ax,359 ; bad column
jmp f&functype&_out ; get out
f&functype&_4:
cmp ax,79 ; is it greater than 79
jbe f&functype&_5 ; ok so far
mov ax,359 ; bad column
jmp f&functype&_out ; get out
f&functype&_5:
shl ax,1 ; multiply by 2
add di,ax ; add in the column offset
ELSE
mov ax,[bp+row] ; get row
cmp ax,0 ; is it less than 0
jae f&functype&_2 ; ok so far
mov ax,358 ; bad row
jmp f&functype&_out ; get out
f&functype&_2:
cmp ax,24 ; is it greater than 24
jbe f&functype&_3 ; ok so far
mov ax,358 ; bad row
jmp f&functype&_out ; get out
f&functype&_3:
mov dh,al ; save this
mov ax,[bp+col] ; get column
cmp ax,0 ; is it less than 0
jae f&functype&_4 ; ok so far
mov ax,359 ; bad column
jmp f&functype&_out ; get out
f&functype&_4:
cmp ax,79 ; is it greater than 79
jbe f&functype&_5 ; ok so far
mov ax,359 ; bad column
jmp f&functype&_out ; get out
f&functype&_5:
mov dl,al ; add in the column offset
mov bh,0 ; set current page
mov ah,2 ; do a set cursor call
int 10h ; move the cursor there
ENDIF
endm
Scroll_Stuff macro functype,scrltype
mov ax,[bp+20] ; get top row
mov ch,al ; put in place
mov ax,[bp+18] ; get left column
mov cl,al ; put in place
mov ax,[bp+16] ; get bottom row
mov dh,al ; put in place
mov ax,[bp+14] ; get right column
mov dl,al ; put in place
lds si,[bp+8] ; get pointer to cell
lodsw ; get the cell to use
mov bh,ah ; put attribute in place
mov ax,[bp+12] ; get lines to scroll
or ax,ax ; is it 0?
jne f&functype&_20 ; no, so go on
mov ax,0 ; nothing to do, so return good
jmp f&functype&_out ; go away
f&functype&_20:
cmp ax,-1 ; if it is -1, make it 0
jne f&functype&_21 ; its not, so go on
xor ax,ax ; make it 0
f&functype&_21:
mov ah,scrltype ; scroll down BIOS call
int 10h ; do the call
endm
;* This macro is an addition by David Page, used to implement support
;* for DESQview, especially with X00
DESQview_shadow macro
push di ;setup for DESQview shadow call
push es ;which is safe even if DV not there
mov ax,adapter_base ;get current adapter base
mov es,ax ;and put it in es
mov ah,0feH ;code for SHADOW call, invalid if DV not there
mov di,0 ;offset always 0
int 10H ;ignored by DOS if DV not there
mov ax,es ;retrieve the adapter base
mov adapter_base,ax ;and store it
pop es
pop di
endm